//
//  PicOneTableViewCell.m
//  项目
//
//  Created by 张诗雨 on 14/12/31.
//  Copyright (c) 2014年 张诗雨. All rights reserved.
//

#import "PicOneTableViewCell.h"
#import "WebColor.h"
@implementation PicOneTableViewCell
- (void)dealloc
{
    [super dealloc];
    [_imgView release];
    [_introLable release];
    [_titleLable release];
    [_coverImg release];
    [_typeLable release];
    [_picCount release];
}
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.backgroundColor = [WebColor whiteSmoke];
        self.typeLable = [[UILabel alloc] initWithFrame:CGRectMake(20, 0, 100, 20)];
        self.typeLable.textColor = [WebColor steelBlue];
        self.typeLable.font = [UIFont systemFontOfSize:15.0f];
        [self.contentView addSubview:self.typeLable];
        [_typeLable release];
        
        self.imgView = [[UIImageView alloc] init];
        self.imgView.image = [UIImage imageNamed:@"bg_share_large.png"];
        [self.contentView addSubview:self.imgView];
        [_imgView release];
        
//        self.introButton = [UIButton buttonWithType:UIButtonTypeCustom];
//        [self.contentView addSubview:self.introButton];
        
        self.coverImg = [[UIImageView alloc] init];
        self.coverImg.backgroundColor = [WebColor tan];
        [self.imgView addSubview:self.coverImg];
        
        self.titleLable = [[UILabel alloc] init];
        self.titleLable.textAlignment = NSTextAlignmentLeft;
        self.titleLable.font = [UIFont boldSystemFontOfSize:19.0f];
        [self.imgView addSubview:self.titleLable];
        [self.titleLable release];
        
        self.introLable = [[UILabel alloc] init];
        self.introLable.font = [UIFont systemFontOfSize:16.0f];
        self.introLable.textColor = [WebColor silver];
        self.introLable.numberOfLines = 2;
        self.introLable.textAlignment = NSTextAlignmentRight;
        [self.imgView addSubview:self.introLable];
        [_introLable release];
        
        self.picCount = [[UILabel alloc] init];
        self.picCount.backgroundColor = [UIColor blackColor];
        self.picCount.textAlignment = NSTextAlignmentCenter;
        self.picCount.alpha = 0.7;
        self.picCount.textColor = [UIColor whiteColor];
        self.picCount.font = [UIFont boldSystemFontOfSize:16.0f];
        [self.imgView addSubview:self.picCount];
        [_picCount release];
        
        
    }
    return self;
}
- (void)layoutSubviews
{
    [super layoutSubviews];
    self.imgView.frame = CGRectMake(10, 25, self.frame.size.width - 20, self.frame.size.height - 35);
    self.coverImg.frame = CGRectMake(0, 0, self.imgView.frame.size.width,self.imgView.frame.size.height - 80);
//    self.introButton.frame = CGRectMake(0, self.imgView.frame.size.height - 80, self.imgView.frame.size.width, 80);
    self.picCount.frame = CGRectMake(self.imgView.frame.size.width - 50, self.coverImg.frame.size.height - 50, 40, 40);
    self.titleLable.frame = CGRectMake(10, self.imgView.frame.size.height - 75, self.frame.size.width - 20, 20);
    self.introLable.frame = CGRectMake(0, self.imgView.frame.size.height - 50, self.frame.size.width - 25, 45);
    
}@end
